<%@ tag import="java.util.*" %>
<%@ attribute name="item" required="true" %>
<%@ attribute name="amount" type="java.lang.Integer" required="true" %>
<%	
   if (!item.isEmpty() && amount > 0 && session.getAttribute("cart") != null) {
      @SuppressWarnings("unchecked")
	  Map<String, Integer> cart = (Map<String, Integer>)session.getAttribute("cart");
		
	  Integer a = cart.get(item);
	  if (a == null) 
	     a = new Integer(0);
    
	  cart.put(item, new Integer(a.intValue() + amount));
   }
%>